package com.lww.feature.test.bigdecimal;

import org.apache.commons.csv.CSVPrinter;
import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.StringWriter;
import java.math.BigDecimal;

import static javafx.scene.input.KeyCode.T;

/**
 * @author yi an
 * @date 2017/3/27
 */
public class test {

    @Test
    public void testDemo() {
        long a = 1929292;
        BigDecimal divide = new BigDecimal(a).divide(new BigDecimal(100));
        System.out.println(divide);
        StringWriter stringWriter = new StringWriter();
    }

    @Test
    public void integerToBigDecimal() {
        int a = 1;
        Integer b =2;
        int c =99898989;
        float d = 9.1f;
        System.out.println(new BigDecimal(a));
        System.out.println(new BigDecimal(b));
        System.out.println(new BigDecimal(c));
        System.out.println(new BigDecimal(d));
        System.out.println((new BigDecimal(a)).movePointLeft(2));
        System.out.println((new BigDecimal(b)).movePointLeft(2));
        System.out.println((new BigDecimal(c)).movePointLeft(2));
        System.out.println((new BigDecimal(d)).movePointLeft(2));
    }
}
